﻿#ifndef C3FDMESHCONTROLWIDGET_H
#define C3FDMESHCONTROLWIDGET_H

#include <QWidget>
#include <QProcess>
#include <QTreeWidgetItem>
#include "Common/C3fdProject.h"
#include "Common/C3fdCase.h"

namespace Ui
{
	class C3fdMeshControlWidget;
}

namespace MainWidget
{

	class C3fdMeshControlWidget : public QWidget
	{
		Q_OBJECT

	public:
		C3fdMeshControlWidget(QTreeWidgetItem *rowItem, QWidget *parent = nullptr);
		~C3fdMeshControlWidget();

	signals:
		void sendMessage(QString);
		void renderC3fdMeshSig(QStringList meshFiles);

	public slots:
		void on_comb_BladeType_currentIndexChanged(int index);
		void on_dsb_Gap_editingFinished();
		void on_dsb_RootFillet_editingFinished();
		void on_dsb_TipFillet_editingFinished();
		void on_pb_Save_clicked();
		void on_pb_GenerateMesh_clicked();
		void processFinished(int, QProcess::ExitStatus);
		void readProcessOutput();
		void readAllStandardErrorSlot();

	private:
		Ui::C3fdMeshControlWidget *m_Ui = nullptr;
		QProcess m_Process{};
		Common::C3fdProject *m_Project = nullptr;
		Common::BladeRow *m_BladeRow = nullptr;
	};

}
#endif // C3FDMESHCONTROLWIDGET_H
